<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Trang chu</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php require("conn.php");
if(isset($_GET['lang'])) $lang=$_GET['lang'];
else $lang=0;
if($lang==0)
{
$sql1 =sprintf("select URL,id,vi_name as name from tblmenu where section_id='0' order by id ");
$sql2 =sprintf("select URL,id,vi_name  as name,parent_id from tblmenu where section_id<>'0'");
$sql3 =sprintf("select URL,id,vi_name  as name,parent_id from tblmenu where section_id='-1' ");
$Articlestr=sprintf("select vi_title as title,vi_content as content,vi_summary,image   from tblarticle where id='%s' ",$_GET['id']);
}

else
{
$sql1 =sprintf("select URL,id,en_name as name from tblmenu section_id='0'");
$sql2 =sprintf("select URL,id,en_name  as name,parent_id   from tblmenu where section_id>'0'   ");
$sql3 =sprintf("select URL,id,en_name  as name,parent_id  from tblmenu where section_id='-1' ");

$Articlestr=sprintf("select en_title as title,en_content as content,en_summary,image   from tblarticle where id='%s' ",$_GET['id']);

}
$Menus1 = mysql_query($sql1) or die(mysql_error());
$Menus2 = mysql_query($sql2) or die(mysql_error());
$Menus3 = mysql_query($sql3) or die(mysql_error());
$value= mysql_query($Articlestr) or die(mysql_error());
$values=mysql_fetch_assoc($value);
?>
<div id="id_all">
    
    
    <div id="id_cen">
    	<div  id="id_cen_left">
        	<div id="menu">
                <ul>
                <?php while($menu1=mysql_fetch_assoc($Menus1))
				{
                    echo "<li>";
					echo "<a";
				 if($menu1['URL']!='') echo " href='".$menu1['URL']."'";
				 echo">".$menu1['name']."</a>";
					$childsection=0;
					   
                       while($menu2=mysql_fetch_assoc($Menus2))
					   {
						
						   if($menu2['parent_id']==$menu1['id'])
						   { 
                              if($childsection==0)
							  { echo "<div class='arrow'></div>";
                                echo "<ul>";
								$childsection=1;
							  }
							     echo "<li>";echo "<a";
							    if($menu2['URL']!='') echo " href='".$menu2['URL']."'";echo">".$menu2['name']."</a>";
							   $childend=0;
									while($menu3=mysql_fetch_assoc($Menus3))
										{
											
											if($menu2['id']==$menu3['parent_id'])
											   {
													if($childend==0)
													  { 
													    echo "<div class='arrow'></div>";
														echo "<ul>";
														$childend=1;
													  }
													 echo "<li><a href='".$menu3['URL']."'>".$menu3['name']."</a></li>";
											   }
											
										}
										mysql_data_seek($Menus3,0);
								  if($childend==1)
									echo "</ul>";
							  echo "</li>";
						   }
						  
						}
						mysql_data_seek($Menus2,0);
						if($childsection==1)
				          echo "</ul>";		
			       echo "</li>";		
				}
				?>
                </ul>
	
    		</div>
        	
        </div>
        <div id="id_cen_right">
        	<div id="id_cen_right_un">
        	  <div id="id_cen_right_fot">
               	  <?php if(isset($_GET['id']))
					?>
			    <h2 id="titlecontent" ><?php echo $values['title']; ?></h2>
 <br />

<div id="content"> <?php echo " <img id='img' src='".$values['image']."' style='margin-right: 18px;'" ."/>";  echo $values['content']; ?> </div></div>
				
          </div>
      </div>
        </div>
    </div>
    <div id="footer">
        	<span class="line"></span>
            
            <p style="float: left; color:#f57020; margin-left: 100px; margin-top:-10px;	text-align:center;">Copyright &copy; IDG 2010</p>
        </div>
</div>
</body>
</html>
